<!DOCTYPE html>
<html class="um landscape min-width-240px min-width-320px min-width-480px min-width-768px min-width-1024px">
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
        <meta name="description" content="" />
        <meta name="keywords" content="" />
        <meta name="author" content="Flying hormone" />
        <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, minimum-scale=1, user-scalable=no">
        <meta name="renderer" content="webkit">
        <meta http-equiv="X-UA-Compatible" content="IE=edge">
        <meta charset="UTF-8">
        <link rel="stylesheet" href="../css/media.css" />
        <link rel="stylesheet" href="../css/mui.min.css" />
        <link rel="stylesheet" href="../css/head_foot.css" />
        <script type="text/javascript" src="../js/jquery-1.9.1.js"></script>
        <script type="text/javascript" src="../js/jquery.Query.js" ></script>
        <script type="text/javascript" src="../js/jquery-cookie.js"></script>
        <script type="text/javascript" src="../js/mui.min.js"></script>
        <script type="text/javascript" src="../js/appcan.js"></script>
        <script type="text/javascript" src="../js/appcan.control.js"></script>
        <script type="text/javascript" src="../js/common.js" ></script>
		<title>我的关注</title>
		<style>
            
            .quyu{ position: relative;}
            .quyu select{ background: none; margin-bottom: 0; }
            .xiangxia{ position: absolute; top: 0.625em; right: 0.625em; z-index: -100; }
            .tu_2 img{
                width: 100%;
                background: #fff;
            }
            .tu_2 a{ display: block; position: relative; overflow: hidden; height: auto; padding: 0.625em 1em;}
            .opa{    padding-left: 2.5em;
                    padding-right: 0.3125em;
                    line-height: 2.5em;
                    position: absolute;
                    bottom: 1em;
                    right: 1em;
                    background: url(img/opa_f36.png) repeat;
                    height: 2.5em;
                    color: #fff;
                    background-color: #000;
                    font-size: 0.8em;}
            .opa img{ height: 1.875em; width: auto; padding: 0; margin: 0; background: none; position: absolute; left: 0.3125em; top: 0.3125em; }
            .mui-media-body{
                line-height: 1.2em;
            }
        </style>
	</head>

	<body>
		<header>
			<a><span class="leftleft"></span></a>
			<h1>我的关注</h1>
		</header>
		<section class="tu_2" id="gz1">
		</section>
		<section class="same_city_search">
			<div>
				<ul class="mui-table-view"  id="gz2">
				</ul>
			</div>
		</section>
		<footer>
			<nav class="mui-bar mui-bar-tab">
				<a href="javascript:;" id="tcIndex">
                    <img src="../img/shouye2.png" />
                    <span class="mui-tab-label">首页</span>
                </a>
                <a href="javascript:;" id="myfabu">
                    <img src="../img/fabu2.png" />
                    <span class="mui-tab-label">发布</span>
                </a>
                <a class="action" href="javascript:;" id="myInfo">
                    <img src="../img/mine2.png" />
                    <span class="mui-tab-label">我的</span>
                </a>
			</nav>
		</footer>
        <script>
            var userId = appcan.locStorage.getVal("userId");
            $(function(){
                appcan.ajax({
                    type:"post",
                    async:false,       
                    url:host+"/getFavList.json?userId="+userId,
                    data:"",
                    dataType:"json",
                    contentType: "application/json",
                    success : function(dataResult) {
                        var dataList = dataResult.data;
                        var gz1 = "";
                        var gz2 = "";
                        if(dataList.length>0){
                            for(var i=0;i<dataList.length;i++){
                                var actType = dataList[i].actType;
                                var num = actType.substring(1,actType.length);
                                if(num==1){
                                    gz1 += '<a href="javascript:;"><img onclick="openUrl(\'../page/info.html?actId='+dataList[i].id+'\',\'actinfo\');" src="'+hostIp+dataList[i].mainPic+'" />';
                                    gz1 += '<div class="opa" onclick="cancel(\''+dataList[i].id+'\',\''+dataList[i].favId+'\');"><img src="../img/quxiao.png" />取消关注</div></a>';
                                }else{
                                    gz2 += '<li class="mui-table-view-cell mui-media">';
                                    gz2 += '<a href="javascript:;">';
                                    gz2 += '<img onclick="openUrl(\'../page/info.html?actId='+dataList[i].id+'\',\'actinfo\');" class="mui-media-object mui-pull-left" src="'+hostIp+dataList[i].mainPic+'">';
                                    gz2 += '<div style="margin-right: 5em;" onclick="openUrl(\'../page/info.html?actId='+dataList[i].id+'\',\'actinfo\');" class="mui-media-body"><p class="mui-ellipsis">'+dataList[i].shopName;
                                    gz2 += '</p>'+dataList[i].summary+'';
                                    gz2 += '</div></a><div class="opa" onclick="cancel(\''+dataList[i].id+'\',\''+dataList[i].favId+'\');"><img src="../img/quxiao.png" />取消关注</div></li>';
                                }
                            }
                        }
                        $("#gz1").html(gz1);
                        $("#gz2").html(gz2);
                    }
                }) 
            })
            //取消关注
            function cancel(actId,favId){
                appcan.ajax({
                    type:"post",
                    url:host+"/operateAct.json?actId="+actId+"&logType=7&userId="+userId+"&favId="+favId,
                    data:'',
                    dataType:"json",
                    contentType: "application/json",
                    success : function(dataResult) {
                        appcan.window.alert({
                            title:"提示",
                            content:"取消关注成功",
                            button:"确定"
                        });
                        openUrl('my_guanzhu.html','my_guanzhu');
                    }
                })
                return false;
            }
        </script>
	</body>

</html>